/*
 * Config.cpp
 *
 *  Created on: 2011-03-20
 *      Author: kamil
 */

#include "CmdLineParser.h"
#include <boost/program_options.hpp>
#include <iostream>

namespace po = boost::program_options;
using namespace std;

CmdLineParser::CmdLineParser() {}

CmdLineParser::~CmdLineParser() {}

void CmdLineParser::parse(int argc, char **argv){
	std::string robotName;

	po::options_description desc("Autonomic client options");
	desc.add_options()
	    ("help", "produce help message")
	    ("config-file,c", po::value<string>(&configFilePath), "Mgr config file path")
	    ("video-ip,v", po::value<string>(&videoServerIp)->default_value("224.5.5.1"), "Videoserver ip address")
	    ("video-port,p", po::value<int>(&videoServerPort)->default_value(20001), "Videoserver port")
	    ("referee-ip,a", po::value<string>(&refereeIp)->default_value("224.5.23.1"), "Referee multicast adress")
	    ("referee-port,r", po::value<int>(&refereePort)->default_value(10001), "Referee multicast port")
	;

	po::variables_map vm;
	po::store(po::parse_command_line(argc, argv, desc), vm);
	po::notify(vm);

	if (vm.count("help")) {
	    cout << desc << endl;
	    exit(0);
	}

	if (!vm.count("config-file")){
		cout << desc << endl;
		exit(0);
	}
}
